#ifndef TBP_BUILD_H
#define TBP_BUILD_H
#include "graph.h"
#include "type.h"
namespace tbp {
using queue_elem = std::pair<uint32_t, uint32_t>; // (id, start_time)

// 不确定编译器是不是会优化这里，所以选择手动优化
void TBP_Build(BiGraph &graph, Indexes &idx);
void MOReach_in(BiGraph &graph, uint32_t u, uint32_t start_time,
                std::vector<std::vector<Entry>> &label_in);
void MOReach_out(BiGraph &graph, uint32_t vertex_id, uint32_t start_time,
                 std::vector<std::vector<Entry>> &label_out);

void InsertDominate(Entry &candi, std::vector<Entry> &vec);

void FindCanonical(Indexes &candidate, const Indexes &res);

// TODO
bool Query(uint32_t u, uint32_t w, time_pair time_interval, const Indexes& origin);
void Insert2Lable(Indexes &res, Indexes &candidate);

} // namespace tbp

#endif